package org.linlinjava.litemall.wx.web;

import org.linlinjava.litemall.core.util.ResponseUtil;
import org.linlinjava.litemall.wx.annotation.LoginUser;
import org.linlinjava.litemall.wx.service.WxArrivalReminderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author piao
 * @Date 2021/03/19
 */
@RestController
@RequestMapping("/wx/arrivalReminder")
public class WxArrivalReminderController {
    @Autowired
    private WxArrivalReminderService arrivalReminderService;

    @PostMapping("/create")
    public Object create(@LoginUser Integer userId, @RequestParam Integer productId) {
        if (userId == null) {
            return ResponseUtil.unlogin();
        }
        arrivalReminderService.create(userId, productId);
        return ResponseUtil.ok();
    }


}
